package com.haizhi.crm.biz.query;

import com.haizhi.crm.biz.model.UserModuleDetailVo;
import com.haizhi.crm.common.constant.CrmSchema;
import com.haizhi.crm.search.service.SearchService;
import com.haizhi.crm.sys.configure.model.UserModuleSettingVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

/**
 * Created by wangshan on 2018/6/19.
 */
@Service
public class CustomerQueryModelImpl extends AbstractQuery implements QueryModel {

    @Autowired
    private SearchService searchService;

    @Autowired
    private QueryEngine queryEngine;

    @Override
    public UserModuleDetailVo query(UserModuleSettingVo userModuleSettingVo) {
        return query(userModuleSettingVo, CrmSchema.COMPANY, CrmSchema.FIELD_OBJECT_KEY);
    }

    @PostConstruct
    public void init() {
        queryEngine.register("Company", this);
    }
}
